package com.stationpc.dock.receiver

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import androidx.core.content.ContextCompat
import com.stationpc.dock.service.DockOverlayService

class LongPressPageDownReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        if (intent.action == Intent.ACTION_CLOSE_SYSTEM_DIALOGS) {
            // Logic to toggle the dock visibility
            val dockIntent = Intent(context, DockOverlayService::class.java)
            dockIntent.action = DockOverlayService.ACTION_TOGGLE_VISIBILITY
            ContextCompat.startForegroundService(context, dockIntent) // Use for Android 8.0+
        }
    }
}
